eststo clear


**Table 1
use "$data/demog_meta.dta", clear
keep if as_of>=2010
egen p999=pctile(rate_spread), p(99.9)
keep if rate_spread<p999
keep if loan_amount>=50
gen treat=0
replace treat=1 if rate_spread>=5.75
gen after=0
replace after=1 if as_of>=2014
eststo: reg rate_spread i.treat i.after i.after#i.treat, vce(cluster respo)


*loan amount
use "$data/demog_meta.dta", clear
keep if as_of>=2010
egen p999=pctile(rate_spread), p(99.9)
keep if rate_spread<p999
keep if loan_amount>=50
gen treat=0
replace treat=1 if rate_spread>=5.75
gen after=0
replace after=1 if as_of>=2014
eststo: reg loan_amount i.treat i.after i.after#i.treat, vce(cluster respo)


**below 50k
*interest rate
use "$data/demog_meta.dta", clear
keep if as_of>=2010
egen p999=pctile(rate_spread), p(99.9)
keep if rate_spread<p999
keep if loan_amount<50
gen treat=0
replace treat=1 if rate_spread>=7.75
gen after=0
replace after=1 if as_of>=2014
eststo: reg rate_spread i.treat i.after i.after#i.treat, vce(cluster respo)



*loan amount
use "$data/demog_meta.dta", clear
keep if as_of>=2010
egen p999=pctile(rate_spread), p(99.9)
keep if rate_spread<p999
keep if loan_amount<50
gen treat=0
replace treat=1 if rate_spread>=7.75
gen after=0
replace after=1 if as_of>=2014
eststo: reg loan_amount i.treat i.after i.after#i.treat, vce(cluster respo)



esttab using "$regressions/interest_and_loan_amount.tex", b(a2) r2(a2) replace se label postfoot("") keep(`X') order(`X') s(r2 N, label("R$^2$" "Observations")) compress
eststo clear


***Appendix Table A2

eststo clear


**above 50k
*interest rate
use "$data/demog_meta.dta", clear
encode respond, gen(nb_respond)
keep if as_of>=2010
egen p999=pctile(rate_spread), p(99.9)
keep if rate_spread<p999
keep if loan_amount>=50
gen treat=0
replace treat=1 if rate_spread>=5.75
gen after=0
replace after=1 if as_of>=2014
xtset nb_respond
eststo: xtreg rate_spread i.treat i.after i.after#i.treat, fe vce(cluster nb_respo) 


*loan amount
use "$data/demog_meta.dta", clear
encode respond, gen(nb_respond)
keep if as_of>=2010
egen p999=pctile(rate_spread), p(99.9)
keep if rate_spread<p999
keep if loan_amount>=50
gen treat=0
replace treat=1 if rate_spread>=5.75
gen after=0
replace after=1 if as_of>=2014
xtset nb_respond
eststo: xtreg loan_amount i.treat i.after i.after#i.treat, fe vce(cluster nb_respo)


**below 50k
*interest rate
use "$data/demog_meta.dta", clear
encode respond, gen(nb_respond)
keep if as_of>=2010
egen p999=pctile(rate_spread), p(99.9)
keep if rate_spread<p999
keep if loan_amount<50
gen treat=0
replace treat=1 if rate_spread>=7.75
gen after=0
replace after=1 if as_of>=2014
xtset nb_respond
eststo: xtreg rate_spread i.treat i.after i.after#i.treat, fe vce(cluster nb_respo)



*loan amount
use "$data/demog_meta.dta", clear
encode respond, gen(nb_respond)
keep if as_of>=2010
egen p999=pctile(rate_spread), p(99.9)
keep if rate_spread<p999
keep if loan_amount<50
gen treat=0
replace treat=1 if rate_spread>=7.75
gen after=0
replace after=1 if as_of>=2014
xtset nb_respond
eststo: xtreg loan_amount i.treat i.after i.after#i.treat, fe vce(cluster nb_respo)



esttab using "$regressions/interest_and_loan_amount.tex", b(a2) r2(a2) replace se label postfoot("") keep(`X') order(`X') s(r2 N, label("R$^2$" "Observations")) compress
eststo clear
